<template>
  <div class="bottom-bar">
    <div class="bar-left">
      <div>
        <i class="icon service"></i>
        <span class="text">客服</span>
      </div>
      <div>
        <i class="icon shop"></i>
        <span class="text">店铺</span>
      </div>
      <div>
        <i class="icon" :class="{'select':isCollected}"></i>
        <span class="text" @click="isCollected=!isCollected">收藏</span>
      </div>
    </div>
    <div class="bar-right">
      <div class="cart">加入购物车</div>
      <div class="buy">购买</div>
    </div>
  </div>
</template>

<script scoped>
export default {
   name: "BottomNavBar",
   data() {
       return {
         isCollected: false
       }
   },

}
</script>

<style lang='less' scoped>
  .bottom-bar {
    background-color: #eee;
    width: 100%;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    .flex();
    height: 1rem;
    text-align: center;
    .bar-left {
      flex: 1;
      .flex();
      align-items: center;
      div {
        flex: 1;
        .icon {
           display: block;
            width: .44rem;
            height: .44rem;
            margin: 0 auto .06rem;
            background: url("~assets/img/detail/detail_bottom.png") 0 0/cover;
        }
        .service {
           background-position:0 -54px;
        }
        .shop {
           background-position:0 -2rem;
        }
        .select {
          background-position: 0 -.52rem;
        }

      }
    }
    .bar-right {
      flex: 1;
      .flex();
      div {
         flex: 1;
         height: 1rem;
         line-height: 1rem;
      }
      .cart {
        background-color: #ffe817;
        color: #333;
      }
      .buy {
        background-color: #f69;
      }
    }
  }
</style>
